Rails.application.routes.draw do

  #又盘云图片上传
  post 'upload' ,to: 'uploader#upload'
  #文件上传
  post 'upload_attachment' ,to: 'uploader#upload_attachment'


  resources :users      #用户
  resources :post_types #论文类型
  root 'posts#index'

  #resources :common, only: [:new, :create, :destroy], path:'' do
    get 'login', to: 'common#new'
    post 'login', to: 'common#create'
    get 'logout', to: 'common#destroy'
    get 'sign_up', to: 'common#register'#注册页面
    post 'sign_up', to: 'common#do_register'#注册页面
  #end
  resources :posts, path:'pages' do
    resources :relationships, only: [:create, :destroy]
  end

  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
